package com.example.emqx.controller;

import com.example.emqx.entity.ApiResponse;
import com.example.emqx.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * File: MockDateController.java
 * Author: liufudong@szyh-smart.com
 * Date: 2024/9/19
 * Description: MockDateController class.
 */
@Slf4j
@RestController
public class MockDateController {
    @GetMapping("/mockData")
    public ApiResponse<ArrayList<User>> mockData() {
        log.info("mockData");
        ArrayList<User> users = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            users.add(User.builder().id(i).username("张三"+i).build());
        }
        return ApiResponse.success(users);
    }
}
